<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	template="/layout/template.xhtml">

	<ui:define name="body">

		<rich:panel>
			<f:facet name="header">#{messages.SemesterList}</f:facet>

			<div class="results">

				<h:outputText value="No semester exists"
					rendered="#{empty semesterList.resultList}" />

				<h:dataTable id="semesterList" var="semester" value="#{semesterList.resultList}"
					rendered="#{not empty semesterList.resultList}">
					<h:column>
						<f:facet name="header">#{messages.semesterName}</f:facet>
						<s:link id="semesterEdit" value="#{semester.name}" propagation="none"
							view="/Settings/Semester/semester.xhtml">
							<f:param name="instanceId" value="#{semester.id}" />
						</s:link>
					</h:column>
					<h:column>
						<f:facet name="header">#{messages.semesterStartDate}</f:facet>
						<h:outputText value="#{semester.startDate}">
                            <s:convertDateTime dateStyle="both" pattern="dd/MM/yyyy"/>
                        </h:outputText>
					</h:column>
					<h:column>
						<f:facet name="header">#{messages.semesterEndDate}</f:facet>
						<h:outputText value="#{semester.endDate}">
                            <s:convertDateTime dateStyle="both" pattern="dd/MM/yyyy"/>
                        </h:outputText>
					</h:column>
					
				</h:dataTable>

			</div>

		</rich:panel>

		<div class="actionButtons">
			<s:button id="createSemester" value="#{messages.createSemester}"
				view="/Settings/Semester/semester.xhtml"
				action="#{semesterHome.clearInstance()}"/>
			
			<s:button id="back" value="#{messages.Back}"
				view="/Settings/SettingsHome.xhtml" />

		</div>

	</ui:define>

</ui:composition>
